package com.xczl.book.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xczl.book.dao.BookDao;
import com.xczl.book.entity.Book;

@Service
public class BookService {

	@Autowired
	private BookDao bookDao;
	
	/**
	 * 增加
	 * @param book
	 */
	public void add(Book book) {
		// Dao插入数据
		bookDao.insertBook(book);
	}
	
	/**
	 * 编辑
	 * @param book
	 */
	public void update(Book book) {
		//Dao修改数据
		bookDao.updateBook(book);
	}

	/**
	 * 删除
	 * @param book
	 */
	public int delete(int bookID) {
		// TODO Auto-generated method stub
		return bookDao.deleteBook(bookID);
	}
	
}
